<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>列表渲染</title>
</head>
<body>
<!--
    v-for遍历数组
-->
<div id="app">
    <ul>
        <li v-for="(person,index) in persons" :key="person.id">
            {{person.id}}-----{{ person.name}}---{{person.age}}
        </li>
    </ul>
</div>
<script src="js/vue.js"></script>
<script>
    const vm=new Vue({
        el:'#app',
        data:{
            persons:[
                {id:1,name:'zhaoliying',age:33},
                {id:2,name:'yangmi',age:34},
                {id:3,name:'qiwei',age:33},
                {id:4,name:'dili',age:20}
            ]
        }
    });
</script>
</body>
</html>